#pragma once
#include "BlockRenderer.h"
#include "BlockLibrary.h"
#include "IContentLoader.h"
#include "gamescreen.h"
#include "Camera.h"
#include "Chunk.h"
#include "Axis.h"
#include "base.h"
#include "World.h"
#include "Player.h"
class ScrGame :
	public GameScreen, IContentLoader
{
public:
	ScrGame(void);
	virtual ~ScrGame(void);
	virtual void Render();
	virtual void Update();
	virtual bool ScreenInit(IGame *pGame);
	virtual void OnScreenRemoved();
	virtual string GetInternalName();
	
public: // IContentLoader function
	virtual int RegisterCraftingRecipes();
	virtual int RegisterItemTemplates();
	virtual int RegisterBlockTemplates();
	virtual std::string GetInstanceName();
	virtual int GetLoaderType();

protected: // Helper functions
	vector2 GetMouse();
	void DrawBlock(vector3 &pos, uint blockId);

private: // Properties
	//Player camera
	boost::shared_ptr<ICamera> m_pCamera;
	//last mouse position for calculating mouse-delta
	vector2 m_lastMouse;

	//World rendering
	BlockRenderer *m_pBlockRenderer;
	BlockLibrary *m_pBlocks;
	uint m_nTextureTerrain;
	World *m_pWorld;
	Player *m_pPlayerEntity;

	//Debugging
	Axis m_centralAxis;

public:
	//Blocks used in generator purpose
	static uint blockGravel;
	static uint blockStone;
	static uint blockDirt;
	static uint blockPlanks;
	static uint blockGrass;
	static uint blockWood;
	static uint blockCobble;
	static uint blockBedrock;
};

